package com.digigames;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

public abstract class BaseFeedParser implements FeedParser {	
	   // names of the XML tags
	
	static final  String ROOT = "Record";
    static final  String DESCRIPTION = "Description";
    static final  String ITEM = "Item";
    static final  String ROW = "row";
	
    final URL feedUrl;

    protected BaseFeedParser(String feedUrl){
        try {
            this.feedUrl = new URL(feedUrl);
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }

    protected InputStream getInputStream() {
        try {
        	//Log.e("MY INPUT STREAM : ", feedUrl.openConnection().getInputStream());
            return feedUrl.openConnection().getInputStream();
            
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}